import { useAppStore } from "@/store/modules/app";
import type { Router } from "vue-router";

export function createCancelHttpGuard(router: Router) {
  router.beforeEach(async (to, from, next) => {
    const appStore = useAppStore();
    appStore.clearCancelTokens();
    next();
  });
}
